<template>
    <div class="main">
        <section>
            <div class="btn-block">
                <el-button type="success" size="small" :loading="btnLoading" plain @click="clearAppCache">清除APP首页缓存</el-button>
            </div>
        </section>
    </div>
</template>
<script>
    export default {
        name: 'clearAppCache',
        data(){
            return {
                btnLoading: false
            }
        },
        methods: {
            clearAppCache(){
                this.btnLoading = true;
                this.request({
                    url: '/bsnl-product/home/clear',
                    method: 'get',
                }).then(() => {
                    this.$message.success('清除缓存成功');
                    this.btnLoading = false;
                }).catch(err => {
                    console.log(err);
                    this.btnLoading = false;
                });
            }
        }
    }
</script>
